A typical operating system includes a file system. The file system provides a mechanism for the storage and retrieval of files and a hierarchical directory structure for the naming of multiple files. More specifically, the file system stores information provided by the user (i.e., data) and information describing the characteristics of the data (i.e., metadata). The file system also provides extensive programming interfaces to enable the creation and deletion of files, reading and writing of files, performing seeks within a file, creating and deleting directories, managing directory contents, etc. In addition, the file system also provides management interfaces to create and delete file systems. File systems are typically controlled and restricted by operating system parameters. For example, most operating systems limit the maximum number of file names that can be handled within their file system. Some operating systems also limit the size of files that can be managed under a file system.
An application, which may reside on the local system (i.e., computer) or may be located on a remote system, uses files as an abstraction to address data. Conventionally, this data is stored on a storage device, such as a disk.
To access a file, the operating system (via the file system) typically provides file manipulation interfaces to open, close, read, and write the data within each file. More specifically, the file system stores data on the storage device by managing the allocation of space within the storage device. Typically, the volume manager provides space which is managed by the file system. Two common types of file system space allocation strategies are known as block-based allocation and extent-based allocation. Block-based allocation creates incremental disk space for each file each time the file is extended (i.e., modified via a write request to add information), whereas extent-based allocation creates a large series of contiguous blocks (i.e., extents) each time the file exhausts the space available in the file's last extent.
When allocating space, both block-based and extent-based allocations use space provided by the volume manager. The volume manager allows multiple physical disks to be used as a single volume (i.e., a virtual disk) to provide larger consolidated storage sizes and simpler management. The volume manager allows users to organize data along volume boundaries (i.e., each volume has physical disk space allocated to the volume such that the volume is tied only to that dedicated physical disk). The volume manager is typically implemented as a separate layer between the physical disks and the file system, and is presented to the user as a virtual disk device. In other words, volume managers organize the collections of physical devices (e.g., disks) into virtual devices. Additionally, the space allocated within the volume manager is handled by the file system. Consequently, the volume manager is not aware of which blocks within the available storage space are in use and which blocks are free for data to be stored.
Further, file systems may be mounted on the virtual disk devices. Thus, physical disks are partitioned and allocated to multiple virtual disk devices, and each virtual disk device is capable of having a file system that exclusively uses that particular virtual disk device. A request to access a file is typically performed by an application, via the file system, using a file name and logical offset. This file name and logical offset (i.e., the manner in which applications express file operation requests) corresponds to a location within the virtual disk device. Subsequently, the request is translated to physical disk space on the storage device by the volume manager, allowing the user of the application to access the data within a particular file.
File systems are generally susceptible to data corruption. Data corruption occurs in many forms. Some of the general forms of disk corruption that lead to data integrity issues include: bit rot, misdirected reads, phantom writes, misdirected writes, and user error. More specifically, bit rot describes a situation in which the data becomes corrupted because one or more bits within the data have become corrupted. Bit rot is typically a result of a media error (i.e., physical disk error, etc.). A misdirected read describes a situation in which the wrong portion of data is read from the physical disk. Similarly, a misdirected write corresponds to the situation in which the data is written to a wrong portion of the physical disk (i.e., the data was supposed to be written to location A on the physical disk is instead written to location B on the physical disk).
Further, a phantom write occurs after a write request has been issued to the physical disk and the data is not written to the physical disk, yet the process handling the write request indicates that the data has been written to the physical disk. In addition, to the above forms of disk corruption, data corruption may also be the result of a user error. For example, an administrator may accidentally write over a portion of the physical disk that is already in use.
File systems and/or volume managers may include a mechanism for determining whether the data stored within the file system has been corrupted or otherwise altered. One such mechanism is a checksum. The checksum corresponds to a set of bits obtained by applying a particular formula (e.g., Message Digest 5 (MD5), Fletcher, Cyclic Redundancy Check (CRC), etc.) to the piece of data. The checksum for the particular piece of data is then stored adjacent to the corresponding data in the file system (e.g., using 520 byte sectors). In addition, the system on which the file system is executing may include a mechanism to restore corrupted data. One such mechanism is mirroring. Mirroring corresponds to maintaining multiple copies of the file system across two or more physical disks. The mirrored copies of the file system may be used to restore the file system when a media failure occurs (i.e., the physical disk on which the file system resides fails) or when the file system becomes corrupted (as described above). The mirrored copy of the file system may be used to restore individual files or the entire file system.